package com.tnr.scgcxx.controller.safty;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.tnr.scgcxx.dto.Result;
import com.tnr.scgcxx.dto.Sys_userDto;
import com.tnr.scgcxx.service.safty.LoginService;

/***
 * 用户登录
 * @author 杜凡
 *
 */
@RestController
public class LoginController {

	@Autowired
	LoginService ls;
	@RequestMapping("login")
	public Result login(@RequestBody Sys_userDto dto) {
		Sys_userDto dt=ls.login(dto);
		System.out.println(dto);
		System.out.println(dt);
		if(dt.isSf()) {
			return Result.successResult(dt.getMessige());
		}else {
			return Result.failResult(dt.getMessige());
		}
	}
}
